import pandas as pd
import csv
import matplotlib.pyplot as plt


plt.rcParams['font.sans-serif'] = ['SimHei']
iris = pd.read_csv('new_data.csv', delimiter=';')

for x in [0,1]:
    if x == 0:
        s = '花萼'
    else:
        s = '花瓣'
    plt.show()  #创建新图
    plt.title('鸢尾花'+s+'长度与宽度散点图',fontsize=18)
    plt.xlabel(s+'长度',fontsize=16)
    plt.ylabel(s+'宽度',fontsize=16)

    #下面用字典形式规定三种花的不用标记符号
    for k, v in {'setosa':'r','versicolor':'g','virginica':'b'}.items():
        d = iris[iris.Species == k]
        plt.scatter(d.iloc[:,2*x],d.iloc[:,2*x+1],market=v,s=120,label=k)
    plt.legend(fontsize=14)
